import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:vmall_app/assets/icon_font.dart';

class HomeBanner extends StatelessWidget {
  final bannerHeight;

  const HomeBanner({Key key, this.bannerHeight = 30.0}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(8.0),
      child: Container(
        height: bannerHeight,
        color: Colors.transparent,
        child: Row(
          children: <Widget>[
            Icon(Iconfont.scan_light),
            SizedBox(
              width: 5,
            ),
            Expanded(
              flex: 2,
              child: Container(
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(20),
                      color: Colors.white,
                      border: Border.all(
                          color: Colors.orange,
                          style: BorderStyle.solid,
              
                          width: 1.4)),
                  child: Align(
                    child: Row(
                      children: <Widget>[
                        SizedBox(width: 5,),
                        Icon(
                          Iconfont.search_light,
                          color: Colors.grey,
                          size:20,
                        ),
                        Text(
                          '电动平衡车',
                          style: TextStyle(color: Colors.grey,fontSize: 13),
                        ),
                        Expanded(
                          child: Align(
                            alignment: Alignment.centerRight,
                            child: Container(
                              padding: const EdgeInsets.only(top:6,left: 7,right: 7,bottom: 7),
                              decoration:BoxDecoration(
                                borderRadius: BorderRadius.circular(20),
                                gradient: LinearGradient(
                                colors: [Colors.orange,Colors.red],
                                begin: Alignment.centerLeft,
                                end: Alignment.centerRight
                              )),
                              child:Container(
                                width: 35,
                                padding: const EdgeInsets.only(left: 10),
                                child:  Text('搜 索',style: TextStyle(fontSize: 10,color: Colors.white),),)
                            ),
                          ),
                        ),
                        
                      ],
                    ),
                    alignment: Alignment.centerLeft,
                  )),
            ),
            SizedBox(
              width: 10,
            )
          ],
        ),
      ),
    );
  }
}
